<?php if(isset($drinks)): ?>
    <?php if($drinks): ?>
        <table class="table table-hover table-condensed">
            <tr>
                <form action="" method="post">
                    <td></td>
                    <td>
                        <select name="category">
                            <?php 
                                foreach($categories as $category)
                                    echo '<option value="' . $category->id . '">' . $category->name . '</option>';
                            ?>
                        </select>
                    </td>
                    <td>
                        <select name="taste">
                            <?php
                                foreach($tastes as $taste)
                                    echo '<option value="' . $taste->id . '">' . $taste->name . '</option>';
                            ?>
                        </select>
                    </td>
                    <td>
                        <span rel="tooltip"  
                              title="Performs an availability check that yields drinks you can mix with your current bar stock">
                            <input type="checkbox" name="available" value="1">Availability check
                        </span>
                    </td>
                    <td>
                        <input type="submit" value="Apply filters" class="btn btn-primary">
                    </td>
                </form>
            </tr>
            <tr>
                <th>Name</th>
            </tr>
        <?php 
            foreach($drinks as $drink){
                echo '<tr>
                        <td>' . anchor('/drink/details/' . $drink->id, $drink->name, '') . '</td>
                      </tr>';
            }
        ?>
        </table>
    <?php else: ?>
        <div class="warning">No recipes found!</div>
    <?php endif; ?>
<?php else: ?>
    <div class="error">There was an error retrieving the drink recipes!</div>
<?php endif; ?>
    
